<!DOCTYPE html>
<html lang="Zh-cn">
<head>
	<meta charset="UTF-8">
	<meta name="format-detection" content="telephone=no" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no"/>
	<title>Surprise</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript" src="js/zepto.min.js"></script>
	<script type="text/javascript" src="js/surprise.js"></script>
	<script type="text/javascript" src="http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		function is_weixin() {
		    var ua = navigator.userAgent.toLowerCase();
		    if(ua.match(/MicroMessenger/i) == 'micromessenger'){ 
		        return true;
		    } else {
		        return false;
		    }
		}
		function weixin() {
			var isWeixin = is_weixin();
			if(isWeixin){
				var json = {time:new Date().getTime()};
				var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
				var weixinTip = $('<div id="weixinTip"><p><img src="images/weixin-tip.png" style="display:block;width:100%;" alt="微信打开"/></p></div>');
				$("body").append(weixinTip);
				$("#weixinTip").css({
					"position":"fixed",
					"top": "0",
					"left": "0",
					"width":"100%",
					"height":"100%",
					"z-index":"100",
					"background-color":"rgba(0,0,0,0.8)",
					"opacity":"0.8",
					"filter":"alpha(opacity=80)",
				});
				$("#weixinTip p").css({
					"text-align":"center",
					"position":"relative"
				});
			}
		}
		function countDown(secs, surl) {
			if(--secs > 0){ 
				setTimeout("countDown("+secs+",'"+surl+"')",1000); 
			}
			else
			{
				weixin();
			} 
	       } 
	</script>
</head>
<body>
	<div class="container">
            <div class="mainImg" id="mainImg1">
                <img id="image1" src="images/item_pic.jpg">
            </div>
            <div class="mainImg" id="mainImg2">
                <img id="image2" src="images/surprise-wait.png">
            </div>
        </div>
</body>
<script type="text/javascript">
	countDown(1, "http://baidu.com/");
</script> 
</html>
